<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>鼠标移动改变图片路径</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            list-style: none;
        }
        body{
            background-color: #000;
        }
        .box{
            width: 232px;
            height: 285px;
            background-color: #fff;
            margin: 10px auto;
            position: relative;
            box-sizing: border-box;
            padding: 10px;
            border-radius: 10px;
        }
        img{
            border-radius: 10px;
        }
        #img{
            width: 160px;
        }
        #img img {
            width: 100%;
        }
        .box li{
            width: 50px;
            height: 50px;
        }
        .one{
            position: absolute;
            top: 10px;
            left: 172px;
        }
        .two{
            position: absolute;
            top: 65px;
            left: 172px;
        }
        .three{
            position: absolute;
            top: 119px;
            left: 172px;
        }
        .four {
            position: absolute;
            top: 172px;
            left: 172px;
        }
        .five {
            position: absolute;
            top: 224px;
            left: 172px;
        }
        .six {
            position: absolute;
            top: 172px;
            left: 10px;
        }
        .seven {
            position: absolute;
            top: 172px;
            left: 65px;
        }
        .eight {
            position: absolute;
            top: 172px;
            left: 118px;
        }
        .nine {
            position: absolute;
            top: 224px;
            left: 10px;
        }
        .ten{
            position: absolute;
            top: 224px;
            left: 65px;
        }
        .eleven{
            position: absolute;
            top: 224px;
            left: 118px;
        }
    </style>
</head>
<body>
    <div class="box">
        <div id="img">
            <img  src="./image/small_1.jpg" alt="">
        </div>
    
                <li class="one"><img src="./image/small_1.jpg" alt=""></li>
                <li class="two"><img src="./image/small_2.jpg" alt=""></li>
                <li class="three"><img src="./image/small_3.jpg" alt=""></li>
                <li class="four"><img src="./image/small_4.jpg" alt=""></li>
                <li class="five"><img src="./image/small_5.jpg" alt=""></li>
                <li class="six"><img src="./image/small_6.jpg" alt=""></li>
                <li class="seven"><img src="./image/small_7.jpg" alt=""></li>
                <li class="eight"><img src="./image/small_8.jpg" alt=""></li>
                <li class="nine"><img src="./image/small_9.jpg" alt=""></li>
                <li class="ten"><img src="./image/small_10.jpg" alt=""></li>
                <li class="eleven"><img src="./image/small_11.jpg" alt=""></li>
            
    </div>

    <script>
        window.onload = function(){
            var imgs = document.getElementById('img')
            var lis = document.getElementsByTagName('li')
// console.log(imgs.innerHTML);
            for(let i = 0; i<lis.length; i++){
                lis[i].onmouseenter = function(){
                    imgs.innerHTML = lis[i].innerHTML
                    // console.log(imgs);
                }
            }

        }
    </script>
    
</body>
</html>